home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1986 January
/
1986-01.d64
/
basic windows
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
1KB
|
29 lines
100 h=6:w=18:rem height and width of window
110 r=10:c=10:rem row and column position
120 dim s(h-1,w-1):rem screen code array
130 dim b$(h-1),c$(h-1)
140 b$(0)="[166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166]"
150 b$(1)="[166]deliver messages[166]"
160 b$(2)="[166]in your programs[166]"
170 b$(3)="[166] with windows. [166]"
180 b$(4)="[166] [166]"
190 b$(5)="[166][166][166] f1 to cont.[166][166][166]"
200 rem *** demonstration - set text color & fill screen with characters
210 print"[147]";:fori=48to86:a$=a$+chr$(i):next:fori=1to24:printa$:next
220 rem *** store original screen contents and print window
230 m=983+40*r+c:rem upper left corner of window
240 print"[158]":rem set window color
250 poke214,r-1:print:print"[145]";:rem set row number
260 fori=0toh-1:forj=0tow-1
270 s(i,j)=peek(m+j):next:poke211,c-1:printb$(i):m=m+40:next
280 rem *** convert stored screen codes to printable strings
290 fori=0toh-1:forj=0tow-1:a=s(i,j):ifa<32ora>95thena=a+64:goto310
300 ifa>65thenifa<96thena=a+32
310 c$(i)=c$(i)+chr$(a):next:next
320 rem *** press 'f1' to rewrite original text
330 getr$:ifr$<>chr$(133)then330
340 print"":rem restore original text color
350 poke214,r-1:print:print"[145]";:rem set row number
360 fori=0toh-1:poke211,c-1:printc$(i):next
370 rem return to main program